Perl6 -- Hip,Hip,Hooray!

Eric Wilhelm on 2006-04-23T07:42:31

I must admit that I have barely given Perl6 a corner of my thought in the last several years. I'll make the excuse that I was really busy for the first few years and haven't been busy enough for this last (read: all time is spent looking for work.) But, I'm repenting -- I'm reading the bible...

And I've found myself honestly cheering while I read the design docs! I mean, // is extremely cool by itself, but then you have pairs, smart matching, ranges, etc.

 # perl5
 my $ans = $this + (defined($foo) ? $foo : 0);
 # perl6
 my $ans = $this + $foo // 0;

Ok, that example could be more convincing. Don't take my word for it, read it for yourself.

So why is this so awesome? I get a lot of flack for my dislike of ruby (which, mind you, I rank above lisp and python (in that order -- subject to change, but both are still ahead of PHP)) and I have a hard time articulating exactly what it is that bothers me about them. I'm not playing ignorant language bigot here, so please put away your wagging fingers. The thing is:

... To other language designers, this may seem like a silly thing to agonize over.
-- Larry Wall in Apocalypse 3

See? That is exactly what I mean. When I use other languages, I don't get the impression that anyone agonized over how well things read and how the syntax fits the problem nearly as much as I do with Perl. I guess you could say it speaks to me. Sure perl5 has some warts and oddities, but 95% of the time it mostly gets out of your way and lets you say what you mean rather than requiring you do things that make the computer happy. So, things like "6".to_f and python's "pass" really annoy me. Complete absence of syntax is annoying, so even though lisp gets more points than python for run-time and reflection, the inability to make a statement is a big drawback in my book.

So, three cheers for perl6! As for why you should cheer too, Larry articulates that way better than I could ever hope to in the design documents. Ruby is not perl6, not by a long shot.


Hear hear!

Alias on 2006-04-23T11:31:28

Increasingly, science is discovering that humans are really really good at making the correct decisions about small niggly things by thinking about them a lot, but really really bad about making large sweeping global decisions by thinking about them a lot.

So the ideal scenario is obsessing over the details, and going with your gut on the big decisions.

And Perl for the most part seems to keep getting this right.

And pugs (and Audrey) has done WONDERS for that in Perl 6, because now we don't have to just talk about it, we can actually play with a working example and demonstrate where the problems are.

And this means Perl 6 seems to be getting most of the details right, even if it's taking a long time.

Guts or no guts

bluto on 2006-04-24T16:01:52

Increasingly, science is discovering that humans are really really good at making the correct decisions about small niggly things by thinking about them a lot, but really really bad about making large sweeping global decisions by thinking about them a lot. So the ideal scenario is obsessing over the details, and going with your gut on the big decisions.

I'm not sure the latter follows, but it is certainly used by most PHB's use to justify global decisions. Just because big global decisions are hard doesn't mean that thinking about them in detail is worse than following your gut. For example, where I work people aimlessly clicking on email attachments was becoming a big problem. There are two likely solutions (1) examine the problem in depth and come up with a detailed solution to the problem which may include some programming, training and/or punishing users that continue doing stupid things, or (2) ban all attachments.

Of course (2) was chosen because the cost *appears* much lower (well that and a good portion of the offenders were managers :-). Unfortunately, the cost is very high, perhaps 10x to 100x higher over the entire population than (1). By following their gut, where bookable costs are important, it appears better to waste 1 hour of time per year, every year, for 10,000 people than it is to come up with a one time, 500 hour solution.

Re:Guts or no guts

Eric Wilhelm on 2006-04-25T19:52:17

> the cost *appears* much lower

It does seem that most decisions to spend money are only made under duress or lust. Invisible money is so much easier to spend. Thus, if you propose to save someone invisible money by spending an identifiable sum at a specific time, you will almost always fail to convince them.

What we have is good enough right? OK, I guess we don't need perl6, VectorSection, subversion for the CPAN, or much else of anything new. In the same vein, we could just live in trees and eat bugs. Shrug.

Re:Guts or no guts

bluto on 2006-04-27T17:33:21

What we have is good enough right? OK, I guess we don't need perl6, VectorSection, subversion for the CPAN, or much else of anything new. In the same vein, we could just live in trees and eat bugs. Shrug.

FWIW, I'm all for moving forward. I was merely zeroing in on a specific misconception I've personally seen a lot of. Sometimes I get rather pedantic and divert whole arguments ...

Re: //

Abigail on 2006-04-24T10:51:57

You don't need perl6 to be able to enjoy //. // will be in perl5.10, and there have been patches to enable // in perl5.x ever since 5.8.1 or so.

People have enjoyed // for years - they can't be bothered to wait more than half a dozen years.

As for cheering for perl6, don't expect any cheers from me. I'm not so thrilled about a language that forces me to change my coding style of 20+ years - neither C, nor Java or Python take my precious whitespace away - but perl6 will. But time is in my favour: I doubt we'll see perl6 anytime soon.